Lely core libraries 2.3.4
stdlib.h File Reference

This header file is part of the C11 and POSIX compatibility library; it includes <stdlib.h> and defines any missing functionality. More...

#include <lely/features.h>
#include <stdlib.h>
Include dependency graph for stdlib.h:

Go to the source code of this file.

Functions

void * aligned_alloc (size_t alignment, size_t size)
 Allocates space for an object whose alignment is specified by alignment, whose size is specified by size, and whose value is indeterminate.
 
void aligned_free (void *ptr)
 Causes the space at ptr to be deallocated, that is, made available for further allocation.
 

Detailed Description

This header file is part of the C11 and POSIX compatibility library; it includes <stdlib.h> and defines any missing functionality.

Author
J. S. Seldenthuis jseld.nosp@m.enth.nosp@m.uis@l.nosp@m.ely..nosp@m.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stdlib.h.

Function Documentation

◆ aligned_alloc()

void * aligned_alloc ( size_t  alignment,
size_t  size 
)

Allocates space for an object whose alignment is specified by alignment, whose size is specified by size, and whose value is indeterminate.

The value of alignment SHALL be a valid alignment supported by the implementation and the value of size SHALL be an integral multiple of alignment.

To ensure maximum portability, objects allocated with this function SHOULD be freed with aligned_free().

Returns
either a NULL pointer or a pointer to the allocated space.

Definition at line 48 of file stdlib.c.

◆ aligned_free()

void aligned_free ( void *  ptr)

Causes the space at ptr to be deallocated, that is, made available for further allocation.

If ptr is a NULL pointer, no action occurs. Otherwise, if the argument does not match a pointer earlier returned by aligned_alloc(), or if the space has been deallocated by a call to aligned_free(), the behavior is undefined.

Definition at line 94 of file stdlib.c.