Stan  1.0
probability, sampling & optimization
Classes | Functions
stan::memory Namespace Reference

(Expert) Allocate, free, and manage underlying system memory. More...

Classes

class  chunk_alloc
 
class  stack_alloc
 An instance of this class provides a memory pool through which blocks of raw memory may be allocated and then collected simultaneously. More...
 

Functions

template<typename T >
bool is_aligned (T *ptr, unsigned int bytes_aligned)
 Return true if the specified pointer is aligned on the number of bytes. More...
 

Detailed Description

(Expert) Allocate, free, and manage underlying system memory.

Function Documentation

◆ is_aligned()

template<typename T >
bool stan::memory::is_aligned ( T *  ptr,
unsigned int  bytes_aligned 
)

Return true if the specified pointer is aligned on the number of bytes.

This doesn't really make sense other than for powers of 2.

Parameters
ptrPointer to test.
bytes_alignedNumber of bytes of alignment required.
Returns
true if pointer is aligned.
Template Parameters
Typeof object to which pointer points.

Definition at line 35 of file stack_alloc.hpp.


     [ Stan Home Page ] © 2011–2012, Stan Development Team.