FreeRDP
alignment.c File Reference
#include <stdlib.h>
#include <winpr/config.h>
#include <winpr/crt.h>
#include <stdint.h>
#include <limits.h>
#include "../log.h"

Macros

#define WINPR_ALIGNED_MEM_SIGNATURE   0x0BA0BAB
 
#define WINPR_ALIGNED_MEM_STRUCT_FROM_PTR(_memptr)    (WINPR_ALIGNED_MEM*)(((size_t)(((BYTE*)_memptr) - sizeof(WINPR_ALIGNED_MEM))))
 
#define TAG   WINPR_TAG("crt")
 

Functions

void * winpr_aligned_malloc (size_t size, size_t alignment)
 
void * winpr_aligned_calloc (size_t count, size_t size, size_t alignment)
 
void * winpr_aligned_realloc (void *memblock, size_t size, size_t alignment)
 
void * winpr_aligned_recalloc (void *memblock, size_t num, size_t size, size_t alignment)
 
void * winpr_aligned_offset_malloc (size_t size, size_t alignment, size_t offset)
 
void * winpr_aligned_offset_realloc (void *memblock, size_t size, size_t alignment, size_t offset)
 
static INLINE size_t cMIN (size_t a, size_t b)
 
void * winpr_aligned_offset_recalloc (void *memblock, size_t num, size_t size, size_t alignment, size_t offset)
 
size_t winpr_aligned_msize (void *memblock, size_t alignment, size_t offset)
 
void winpr_aligned_free (void *memblock)
 

Macro Definition Documentation

◆ TAG

#define TAG   WINPR_TAG("crt")

◆ WINPR_ALIGNED_MEM_SIGNATURE

#define WINPR_ALIGNED_MEM_SIGNATURE   0x0BA0BAB

WinPR: Windows Portable Runtime Data Alignment

Copyright 2012 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..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.

◆ WINPR_ALIGNED_MEM_STRUCT_FROM_PTR

#define WINPR_ALIGNED_MEM_STRUCT_FROM_PTR (   _memptr)     (WINPR_ALIGNED_MEM*)(((size_t)(((BYTE*)_memptr) - sizeof(WINPR_ALIGNED_MEM))))

Function Documentation

◆ cMIN()

static INLINE size_t cMIN ( size_t  a,
size_t  b 
)
static
Here is the caller graph for this function:

◆ winpr_aligned_calloc()

void* winpr_aligned_calloc ( size_t  count,
size_t  size,
size_t  alignment 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_aligned_free()

void winpr_aligned_free ( void *  memblock)
Here is the call graph for this function:

◆ winpr_aligned_malloc()

void* winpr_aligned_malloc ( size_t  size,
size_t  alignment 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_aligned_msize()

size_t winpr_aligned_msize ( void *  memblock,
size_t  alignment,
size_t  offset 
)

◆ winpr_aligned_offset_malloc()

void* winpr_aligned_offset_malloc ( size_t  size,
size_t  alignment,
size_t  offset 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_aligned_offset_realloc()

void* winpr_aligned_offset_realloc ( void *  memblock,
size_t  size,
size_t  alignment,
size_t  offset 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_aligned_offset_recalloc()

void* winpr_aligned_offset_recalloc ( void *  memblock,
size_t  num,
size_t  size,
size_t  alignment,
size_t  offset 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_aligned_realloc()

void* winpr_aligned_realloc ( void *  memblock,
size_t  size,
size_t  alignment 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ winpr_aligned_recalloc()

void* winpr_aligned_recalloc ( void *  memblock,
size_t  num,
size_t  size,
size_t  alignment 
)
Here is the call graph for this function:
Here is the caller graph for this function: