You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
623 B
26 lines
623 B
11 years ago
|
#include <stdlib.h>
|
||
|
#include <stdint.h>
|
||
|
#include <string.h>
|
||
|
#include <assert.h>
|
||
|
|
||
|
#include "nlr.h"
|
||
|
#include "misc.h"
|
||
|
#include "mpconfig.h"
|
||
11 years ago
|
#include "qstr.h"
|
||
11 years ago
|
#include "obj.h"
|
||
|
#include "map.h"
|
||
|
#include "runtime0.h"
|
||
|
#include "runtime.h"
|
||
|
|
||
|
// Helpers for sequence types
|
||
|
|
||
|
// Implements backend of sequence * integer operation. Assumes elements are
|
||
|
// memory-adjacent in sequence.
|
||
|
void mp_seq_multiply(const void *items, uint item_sz, uint len, uint times, void *dest) {
|
||
|
for (int i = 0; i < times; i++) {
|
||
|
uint copy_sz = item_sz * len;
|
||
|
memcpy(dest, items, copy_sz);
|
||
|
dest = (char*)dest + copy_sz;
|
||
|
}
|
||
|
}
|