2023-04-11 12:57:07 -07:00
|
|
|
// Protocol Buffers - Google's data interchange format
|
2023-07-10 07:35:36 -07:00
|
|
|
// Copyright 2023 Google LLC. All rights reserved.
|
2023-04-11 12:57:07 -07:00
|
|
|
//
|
2023-09-09 08:59:23 -07:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
2023-04-11 12:57:07 -07:00
|
|
|
|
|
|
|
|
use std::alloc::{alloc, Layout};
|
|
|
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
|
extern "C" fn __pb_rust_alloc(size: usize, align: usize) -> *mut u8 {
|
|
|
|
|
let layout = Layout::from_size_align(size, align).unwrap();
|
|
|
|
|
unsafe { alloc(layout) }
|
|
|
|
|
}
|