forked from ngageoint/six-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed 'externals/coda-oss/' changes from e3e70cf74..df73cbb6e
df73cbb6e Merge pull request ngageoint#345 from mdaus/mem-align 2167292c7 alignment method ebf630751 Merge pull request ngageoint#344 from mdaus/range-list-type f904fab49 doxygen e59888523 incorrect start element in unit test fd5baf864 Range split 918b3f546 polygon --> types 0a5d6cec2 style 21d8c551b RangeList type git-subtree-dir: externals/coda-oss git-subtree-split: df73cbb6ea5e789546ac5be1f11dba349fa0ed18
- Loading branch information
1 parent
5ec496c
commit 24ce07d
Showing
10 changed files
with
918 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* ========================================================================= | ||
* This file is part of mem-c++ | ||
* ========================================================================= | ||
* | ||
* (C) Copyright 2004 - 2020, Radiant Geospatial Solutions | ||
* | ||
* mem-c++ is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this program; If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
#ifndef __MEM_ALIGN_H__ | ||
#define __MEM_ALIGN_H__ | ||
|
||
#include <sys/Conf.h> | ||
|
||
namespace mem | ||
{ | ||
/*! | ||
* Align the input pointer to lay at the next multiple of | ||
* of the provided alignment. | ||
* | ||
* \param[in, out] data Pointer to the address to align to a multiple | ||
* alignment | ||
* \param alignment The alignment to use | ||
*/ | ||
void align(sys::ubyte* __restrict* data, | ||
size_t alignment = sys::SSE_INSTRUCTION_ALIGNMENT); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* ========================================================================= | ||
* This file is part of mem-c++ | ||
* ========================================================================= | ||
* | ||
* (C) Copyright 2004 - 2020, Radiant Geospatial Solutions | ||
* | ||
* mem-c++ is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this program; If not, | ||
* see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
#include <mem/Align.h> | ||
|
||
namespace mem | ||
{ | ||
void align(sys::ubyte* __restrict* data, size_t alignment) | ||
{ | ||
const size_t beyondBoundary = reinterpret_cast<size_t>(*data) % | ||
alignment; | ||
if (beyondBoundary != 0) | ||
{ | ||
*data += alignment - beyondBoundary; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.