Skip to content

Commit 8e0b719

Browse files
rudybearmeta-codesync[bot]
authored andcommitted
igl | IGLU | Qualify malloc() and free() with std:: namespace
Reviewed By: ChristianK275 Differential Revision: D114674841 fbshipit-source-id: 0dfabfd40dbd6fc30da351dd8db2562c6697872b
1 parent f5fd75a commit 8e0b719

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

IGLU/managedUniformBuffer/ManagedUniformBuffer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ ManagedUniformBuffer::ManagedUniformBuffer(igl::IDevice& device,
5454
length_ = ((length_ + roundVal - 1) / roundVal) * roundVal;
5555
useBindBytes_ = (length_ < pageSize);
5656
if (useBindBytes_) {
57-
data_ = malloc(length_);
57+
data_ = std::malloc(length_);
5858
createBuffer = false;
5959
} else {
6060
auto pagesRequired = desc.length / pageSize;
@@ -85,7 +85,7 @@ ManagedUniformBuffer::ManagedUniformBuffer(igl::IDevice& device,
8585

8686
#endif
8787
} else {
88-
data_ = malloc(desc.length);
88+
data_ = std::malloc(desc.length);
8989
}
9090
if (data_ == nullptr) {
9191
result.code = igl::Result::Code::RuntimeError;
@@ -129,7 +129,7 @@ ManagedUniformBuffer::~ManagedUniformBuffer() {
129129
vmAllocLength_);
130130
} else {
131131
#endif
132-
free(data_);
132+
std::free(data_);
133133
#if IGL_PLATFORM_IOS_SIMULATOR
134134
}
135135
#endif

IGLU/simple_renderer/ShaderUniforms.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ ShaderUniforms::ShaderUniforms(igl::IDevice& device,
120120

121121
// All uniform updates will be made to this malloc'ed data block,
122122
// which will later be uploaded to the buffer (if using buffer)
123-
void* data = malloc(bufferAllocationLength);
123+
void* data = std::malloc(bufferAllocationLength);
124124
if (data == nullptr) {
125125
continue;
126126
}
@@ -161,7 +161,7 @@ ShaderUniforms::ShaderUniforms(igl::IDevice& device,
161161

162162
ShaderUniforms::~ShaderUniforms() {
163163
for (auto& allocation : allocations_) {
164-
free(allocation->ptr);
164+
std::free(allocation->ptr);
165165
}
166166
}
167167

0 commit comments

Comments
 (0)